<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=utf-8" />
<title>Class: Ensembl::Core::Gene</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="../../_index.html">Index (G)</a> &raquo; 
    <span class='title'><span class='object_link'><a href="../../Ensembl.html" title="Ensembl (module)">Ensembl</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Core.html" title="Ensembl::Core (module)">Core</a></span></span>
     &raquo; 
    <span class="title">Gene</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Ensembl::Core::Gene
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><span class='object_link'><a href="DBConnection.html" title="Ensembl::Core::DBConnection (class)">DBConnection</a></span></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">ActiveRecord::Base</li>
          
            <li class="next"><span class='object_link'><a href="../DBRegistry/Base.html" title="Ensembl::DBRegistry::Base (class)">DBRegistry::Base</a></span></li>
          
            <li class="next"><span class='object_link'><a href="DBConnection.html" title="Ensembl::Core::DBConnection (class)">DBConnection</a></span></li>
          
            <li class="next">Ensembl::Core::Gene</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
      <dt class="r2">Includes:</dt>
      <dd class="r2"><span class='object_link'><a href="Sliceable.html" title="Ensembl::Core::Sliceable (module)">Sliceable</a></span></dd>
      
    
  
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">lib/ensembl/core/activerecord.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>
The Gene class provides an interface to the gene table. This table contains
mappings of genes to a SeqRegion.
</p>
<p>
This class uses ActiveRecord to access data in the Ensembl database. See
the general documentation of the Ensembl module for more information on
what this means and what methods are available.
</p>
<p>
This class includes the mixin Sliceable, which means that it is mapped to a
SeqRegion object and a Slice can be created for objects of this class. See
Sliceable and Slice for more information.
</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4><div class='inline'></div></h4>
      <pre class="example code"><span class='puts identifier id'>puts</span> <span class='Gene constant id'>Gene</span><span class='dot token'>.</span><span class='find_by_biotype identifier id'>find_by_biotype</span><span class='lparen token'>(</span><span class='string val'>'protein_coding'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='length identifier id'>length</span>
</pre>
    
  </div>

</div>

  
  
  
  
  
  
  
  
  
  
  
  
  

  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#find_all_by_name-class_method" title="find_all_by_name (class method)">+ (Object) <strong>find_all_by_name</strong>(name) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Gene#find_all_by_name class method searches the Xrefs for that name and
returns an array of the corresponding Gene objects.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#find_by_name-class_method" title="find_by_name (class method)">+ (Object) <strong>find_by_name</strong>(name) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Gene#find_by_name class method searches the Xrefs for that name and
returns one Gene objects (even if there should be more).
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#find_by_stable_id-class_method" title="find_by_stable_id (class method)">+ (Object) <strong>find_by_stable_id</strong>(stable_id) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Gene#find_by_stable_id class method fetches a Gene object based on its
stable ID (i.e. the &quot;ENSG&quot; accession number).
</p>
</div></span>
  
</li>

      
    </ul>
  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#all_xrefs-instance_method" title="#all_xrefs (instance method)">- (Object) <strong>all_xrefs</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Gene#all_xrefs method is a convenience method in that it combines three
methods into one.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#display_label-instance_method" title="#display_label (instance method)">- (Object) <strong>display_label</strong> </a>
    

    
      (also: #label, #display_name, #name)
    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Gene#display_label method returns the default name of the gene.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#go_terms-instance_method" title="#go_terms (instance method)">- (Object) <strong>go_terms</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Gene#go_terms method returns all GO terms associated with a gene.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#hgnc-instance_method" title="#hgnc (instance method)">- (Object) <strong>hgnc</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Gene#hgnc returns the HGNC symbol for the gene.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#stable_id-instance_method" title="#stable_id (instance method)">- (Object) <strong>stable_id</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Gene#stable_id method returns the stable_id of the gene (i.e. the ENSG
id).
</p>
</div></span>
  
</li>

      
    </ul>
  


  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="Sliceable.html" title="Ensembl::Core::Sliceable (module)">Sliceable</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="Sliceable.html#length-instance_method" title="Ensembl::Core::Sliceable#length (method)">#length</a></span>, <span class='object_link'><a href="Sliceable.html#project-instance_method" title="Ensembl::Core::Sliceable#project (method)">#project</a></span>, <span class='object_link'><a href="Sliceable.html#seq-instance_method" title="Ensembl::Core::Sliceable#seq (method)">#seq</a></span>, <span class='object_link'><a href="Sliceable.html#slice-instance_method" title="Ensembl::Core::Sliceable#slice (method)">#slice</a></span>, <span class='object_link'><a href="Sliceable.html#start-instance_method" title="Ensembl::Core::Sliceable#start (method)">#start</a></span>, <span class='object_link'><a href="Sliceable.html#stop-instance_method" title="Ensembl::Core::Sliceable#stop (method)">#stop</a></span>, <span class='object_link'><a href="Sliceable.html#strand-instance_method" title="Ensembl::Core::Sliceable#strand (method)">#strand</a></span>, <span class='object_link'><a href="Sliceable.html#transform-instance_method" title="Ensembl::Core::Sliceable#transform (method)">#transform</a></span></p>

  
  
  
  
  
  
  
  <h3 class="inherited">Methods inherited from <span class='object_link'><a href="DBConnection.html" title="Ensembl::Core::DBConnection (class)">DBConnection</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="DBConnection.html#connect-class_method" title="Ensembl::Core::DBConnection.connect (method)">connect</a></span>, <span class='object_link'><a href="DBConnection.html#ensemblgenomes_connect-class_method" title="Ensembl::Core::DBConnection.ensemblgenomes_connect (method)">ensemblgenomes_connect</a></span></p>

  
  
  
  
  
  
  
  <h3 class="inherited">Methods inherited from <span class='object_link'><a href="../DBRegistry/Base.html" title="Ensembl::DBRegistry::Base (class)">DBRegistry::Base</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="../DBRegistry/Base.html#generic_connect-class_method" title="Ensembl::DBRegistry::Base.generic_connect (method)">generic_connect</a></span>, <span class='object_link'><a href="../DBRegistry/Base.html#get_info-class_method" title="Ensembl::DBRegistry::Base.get_info (method)">get_info</a></span>, <span class='object_link'><a href="../DBRegistry/Base.html#get_name_from_db-class_method" title="Ensembl::DBRegistry::Base.get_name_from_db (method)">get_name_from_db</a></span></p>

  

  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="find_all_by_name-class_method">
  
    + (<tt>Object</tt>) <strong>find_all_by_name</strong>(name) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Gene#find_all_by_name class method searches the Xrefs for that name and
returns an array of the corresponding Gene objects. If the name is not
found, it returns an empty array.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1067
1068
1069
1070
1071
1072
1073
1074
1075</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 1067</span>

<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='find_all_by_name identifier id'>find_all_by_name</span><span class='lparen token'>(</span><span class='name identifier id'>name</span><span class='rparen token'>)</span>
  <span class='answer identifier id'>answer</span> <span class='assign token'>=</span> <span class='Array constant id'>Array</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
  <span class='xrefs identifier id'>xrefs</span> <span class='assign token'>=</span> <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='Core constant id'>Core</span><span class='colon2 op'>::</span><span class='Xref constant id'>Xref</span><span class='dot token'>.</span><span class='find_all_by_display_label identifier id'>find_all_by_display_label</span><span class='lparen token'>(</span><span class='name identifier id'>name</span><span class='rparen token'>)</span>
  <span class='xrefs identifier id'>xrefs</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='xref identifier id'>xref</span><span class='bitor op'>|</span>
    <span class='answer identifier id'>answer</span><span class='dot token'>.</span><span class='push identifier id'>push</span><span class='lparen token'>(</span><span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='Core constant id'>Core</span><span class='colon2 op'>::</span><span class='Gene constant id'>Gene</span><span class='dot token'>.</span><span class='find_by_display_xref_id identifier id'>find_by_display_xref_id</span><span class='lparen token'>(</span><span class='xref identifier id'>xref</span><span class='dot token'>.</span><span class='xref_id identifier id'>xref_id</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
  <span class='end end kw'>end</span>

  <span class='return return kw'>return</span> <span class='answer identifier id'>answer</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="find_by_name-class_method">
  
    + (<tt>Object</tt>) <strong>find_by_name</strong>(name) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Gene#find_by_name class method searches the Xrefs for that name and
returns one Gene objects (even if there should be more). If the name is not
found, it returns nil.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1080
1081
1082
1083
1084
1085
1086
1087</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 1080</span>

<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='find_by_name identifier id'>find_by_name</span><span class='lparen token'>(</span><span class='name identifier id'>name</span><span class='rparen token'>)</span>
  <span class='all_names identifier id'>all_names</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='find_all_by_name identifier id'>find_all_by_name</span><span class='lparen token'>(</span><span class='name identifier id'>name</span><span class='rparen token'>)</span>
  <span class='if if kw'>if</span> <span class='all_names identifier id'>all_names</span><span class='dot token'>.</span><span class='length identifier id'>length</span> <span class='eq op'>==</span> <span class='integer val'>0</span>
    <span class='return return kw'>return</span> <span class='nil nil kw'>nil</span>
  <span class='else else kw'>else</span>
    <span class='return return kw'>return</span> <span class='all_names identifier id'>all_names</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="find_by_stable_id-class_method">
  
    + (<tt>Object</tt>) <strong>find_by_stable_id</strong>(stable_id) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Gene#find_by_stable_id class method fetches a Gene object based on its
stable ID (i.e. the &quot;ENSG&quot; accession number). If the name is not
found, it returns nil.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1092
1093
1094
1095
1096
1097
1098
1099</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 1092</span>

<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='find_by_stable_id identifier id'>find_by_stable_id</span><span class='lparen token'>(</span><span class='stable_id identifier id'>stable_id</span><span class='rparen token'>)</span>
  <span class='gene_stable_id identifier id'>gene_stable_id</span> <span class='assign token'>=</span> <span class='GeneStableId constant id'>GeneStableId</span><span class='dot token'>.</span><span class='find_by_stable_id identifier id'>find_by_stable_id</span><span class='lparen token'>(</span><span class='stable_id identifier id'>stable_id</span><span class='rparen token'>)</span>
  <span class='if if kw'>if</span> <span class='gene_stable_id identifier id'>gene_stable_id</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
    <span class='return return kw'>return</span> <span class='nil nil kw'>nil</span>
  <span class='else else kw'>else</span>
    <span class='return return kw'>return</span> <span class='gene_stable_id identifier id'>gene_stable_id</span><span class='dot token'>.</span><span class='gene identifier id'>gene</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="all_xrefs-instance_method">
  
    - (<tt>Object</tt>) <strong>all_xrefs</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Gene#all_xrefs method is a convenience method in that it combines three
methods into one. It collects all xrefs for the gene itself, plus all xrefs
for all transcripts for the gene, and all xrefs for all translations for
those transcripts.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 1105</span>

<span class='def def kw'>def</span> <span class='all_xrefs identifier id'>all_xrefs</span>
  <span class='answer identifier id'>answer</span> <span class='assign token'>=</span> <span class='Array constant id'>Array</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
  <span class='answer identifier id'>answer</span><span class='dot token'>.</span><span class='push identifier id'>push</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='xrefs identifier id'>xrefs</span><span class='rparen token'>)</span>
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='transcripts identifier id'>transcripts</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='transcript identifier id'>transcript</span><span class='bitor op'>|</span>
    <span class='answer identifier id'>answer</span><span class='dot token'>.</span><span class='push identifier id'>push</span><span class='lparen token'>(</span><span class='transcript identifier id'>transcript</span><span class='dot token'>.</span><span class='xrefs identifier id'>xrefs</span><span class='rparen token'>)</span>
    <span class='if if kw'>if</span> <span class='notop op'>!</span> <span class='transcript identifier id'>transcript</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
      <span class='answer identifier id'>answer</span><span class='dot token'>.</span><span class='push identifier id'>push</span><span class='lparen token'>(</span><span class='transcript identifier id'>transcript</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='xrefs identifier id'>xrefs</span><span class='rparen token'>)</span>
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
  <span class='answer identifier id'>answer</span><span class='dot token'>.</span><span class='flatten! fid id'>flatten!</span>
  <span class='return return kw'>return</span> <span class='answer identifier id'>answer</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="display_label-instance_method">
  
    - (<tt>Object</tt>) <strong>display_label</strong> 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='label-instance_method'>label</span>, <span id='display_name-instance_method'>display_name</span>, <span id='name-instance_method'>name</span></span>
    </span>
  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Gene#display_label method returns the default name of the gene.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1057
1058
1059</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 1057</span>

<span class='def def kw'>def</span> <span class='display_label identifier id'>display_label</span>
  <span class='return return kw'>return</span> <span class='Xref constant id'>Xref</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='display_xref_id identifier id'>display_xref_id</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='display_label identifier id'>display_label</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="go_terms-instance_method">
  
    - (<tt>Object</tt>) <strong>go_terms</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Gene#go_terms method returns all GO terms associated with a gene.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1119
1120
1121
1122</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 1119</span>

<span class='def def kw'>def</span> <span class='go_terms identifier id'>go_terms</span>
  <span class='go_db_id identifier id'>go_db_id</span> <span class='assign token'>=</span> <span class='ExternalDb constant id'>ExternalDb</span><span class='dot token'>.</span><span class='find_by_db_name identifier id'>find_by_db_name</span><span class='lparen token'>(</span><span class='string val'>'GO'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='id identifier id'>id</span>
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='all_xrefs identifier id'>all_xrefs</span><span class='dot token'>.</span><span class='select identifier id'>select</span><span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='x identifier id'>x</span><span class='bitor op'>|</span> <span class='x identifier id'>x</span><span class='dot token'>.</span><span class='external_db_id identifier id'>external_db_id</span> <span class='eq op'>==</span> <span class='go_db_id identifier id'>go_db_id</span><span class='rbrace token'>}</span><span class='dot token'>.</span><span class='collect identifier id'>collect</span><span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='x identifier id'>x</span><span class='bitor op'>|</span> <span class='x identifier id'>x</span><span class='dot token'>.</span><span class='dbprimary_acc identifier id'>dbprimary_acc</span><span class='rbrace token'>}</span><span class='dot token'>.</span><span class='uniq identifier id'>uniq</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="hgnc-instance_method">
  
    - (<tt>Object</tt>) <strong>hgnc</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Gene#hgnc returns the HGNC symbol for the gene.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1125
1126
1127
1128
1129
1130</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 1125</span>

<span class='def def kw'>def</span> <span class='hgnc identifier id'>hgnc</span>
  <span class='hgnc_db_id identifier id'>hgnc_db_id</span> <span class='assign token'>=</span> <span class='ExternalDb constant id'>ExternalDb</span><span class='dot token'>.</span><span class='find_by_db_name identifier id'>find_by_db_name</span><span class='lparen token'>(</span><span class='string val'>'HGNC_curated_gene'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='id identifier id'>id</span>
  <span class='xref identifier id'>xref</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='all_xrefs identifier id'>all_xrefs</span><span class='dot token'>.</span><span class='select identifier id'>select</span><span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='x identifier id'>x</span><span class='bitor op'>|</span> <span class='x identifier id'>x</span><span class='dot token'>.</span><span class='external_db_id identifier id'>external_db_id</span> <span class='eq op'>==</span> <span class='hgnc_db_id identifier id'>hgnc_db_id</span><span class='rbrace token'>}</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span>
  <span class='return return kw'>return</span> <span class='nil nil kw'>nil</span> <span class='if if_mod kw'>if</span> <span class='xref identifier id'>xref</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
  <span class='return return kw'>return</span> <span class='xref identifier id'>xref</span><span class='dot token'>.</span><span class='display_label identifier id'>display_label</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="stable_id-instance_method">
  
    - (<tt>Object</tt>) <strong>stable_id</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Gene#stable_id method returns the stable_id of the gene (i.e. the ENSG
id).
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


1051
1052
1053
1054</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/activerecord.rb', line 1051</span>

<span class='def def kw'>def</span> <span class='stable_id identifier id'>stable_id</span>
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='gene_stable_id identifier id'>gene_stable_id</span><span class='dot token'>.</span><span class='stable_id identifier id'>stable_id</span>
  
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Wed Dec 15 19:18:19 2010 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.6.3 (ruby-1.8.7).
</div>

  </body>
</html>